package com.xiaojiezhu.bigsql.core.configuration;

import com.xiaojiezhu.bigsql.model.constant.ColumnType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * @author xiaojie.zhu <br>
 * 时间 2018/5/7 15:04
 * 说明 bigsql environment
 */
class SimpleBigsqlEnvironment implements BigsqlEnvironment {
    public static final Logger LOG = LoggerFactory.getLogger(SimpleBigsqlEnvironment.class);


    private final Map<String,Entry> data;

    public SimpleBigsqlEnvironment(Map<String, Entry> data) {
        this.data = data;
    }

    @Override
    public Entry get(String key) {
        Entry entry = data.get(key);
        if(entry == null){
            LOG.warn("can not find env : " + key);
            return new Entry(ColumnType.VARCHAR , key);
        }
        return entry;
    }





}
